﻿@model IEnumerable<KhuyenMaiVang.DAL.Voucher>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutDetail.cshtml";
    decimal? amount = 0;
}

<h2>Giỏ hàng</h2>
<h3></h3>
<table>
    <thead>
        <th>Tên voucher</th>
        <th>Đơn giá</th>
        <th>Thao tác</th>
    </thead>
    <tbody>
    @if (Model.ToList().Count > 0)
    {
        foreach (var item in Model)
        {
            amount += item.SellPrice;
            <tr>
                <td>@item.Title</td>
                <td>@item.SellPrice</td>
                <td>@Html.ActionLink("Xóa", "Remove", new { id = Model.ToList().IndexOf(item) })</td>
            </tr>
        }
    }
    </tbody>
</table>
@if (Model.ToList().Count > 0)
{
<p> Tổng tiền: @amount</p>
<p>@Html.ActionLink("Thanh toán", "Index", "CheckOut")</p>
}